package org.example.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.pojo.Couplename;

/**
* @author LENOVO
* @description 针对表【coupleName(情侣ID信息表单)】的数据库操作Mapper
* @createDate 2024-04-03 20:38:19
* @Entity org.example.pojo.Couplename
*/
@Mapper
public interface CouplenameMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Couplename record);

    int insertSelective(Couplename record);

    Couplename selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Couplename record);

    int updateByPrimaryKey(Couplename record);

    @Select("select * from coupleName where user1_id=#{id} OR user2_id=#{id}")
    String findById(Integer id);

    @Insert("insert into coupleName(user1_id, user2_id, time_together) values (#{id},#{objectId},#{timeTogether})")
    void add(Integer id, Integer objectId, String timeTogether);

    @Select("select * from coupleName where user1_id=#{id} OR user2_id=#{id}")
    Couplename relationDetails(Integer id);

    @Select("select * from coupleName where user1_id=#{id} OR user2_id=#{id}")
    Couplename CoupleFindById(Integer id);

    @Select("select time_together from coupleName where user1_id=#{id} OR user2_id=#{id}")
    Object getTime(Integer id);
}
